package learning.spring.helloworld;

import learning.spring.helloworld.factory.MessageSupportFactory;
import learning.spring.helloworld.providers.HelloMessageProvider;
import learning.spring.helloworld.providers.MessageProvider;
import learning.spring.helloworld.renderers.MessageRenderer;
import learning.spring.helloworld.renderers.StandardOutMessageRenderer;

/**
 * Hello world!
 */
public class App {
    public static void main(String[] args) {
//        MessageRenderer messageRenderer = new StandardOutMessageRenderer();
//        messageRenderer.setMessageProvider(new HelloMessageProvider());
//        messageRenderer.render();

        MessageSupportFactory messageSupportFactory = MessageSupportFactory.getInstance();
        MessageRenderer messageRenderer = messageSupportFactory.getMessageRenderer();
        MessageProvider messageProvider = messageSupportFactory.getMessageProvider();
        messageRenderer.setMessageProvider(messageProvider);
        messageRenderer.render();
    }
}
